# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-platypus
pkgver=1.4.1
pkgrel=0
pkgdesc="A Free and Open Source Python Library for Multiobjective Optimization"
url="https://github.com/Project-Platypus/Platypus"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-numpy"
checkdepends="py3-pytest-xdist py3-jsonpickle py3-matplotlib"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/Project-Platypus/Platypus/archive/$pkgver/platypus-$pkgver.tar.gz"
builddir="$srcdir/Platypus-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -k 'not test_cli'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/platypus/tests
}

sha512sums="
8d9d51a87f40e7b7925d432b44666c5ebe5cb130f17bed7658ab7122a983b46760e45a69dafcd1123c2994703f1ebd19f87e1fab6068c5306e10bb32a3d4e1b3  platypus-1.4.1.tar.gz
"
